<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<title>影像采集详细信息</title>
<link rel="stylesheet" type="text/css" href="${ctx}/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${ctx}/easyui/easyui_my.css">
<link rel="stylesheet" type="text/css" href="${ctx}/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="${ctx}/css/css.css" />
<style type="text/css">
    .panel-title{ color: #444444;}
</style>
<script type="text/javascript" src="${ctx}/js/jquery-1.7.min.js"></script>
<script type="text/javascript" src="${ctx}/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${ctx }/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${ctx}/js/common.js"></script>
<script type="text/javascript" src="${ctx}/js/jquery.form.js"></script>
<script type="text/javascript" src="${ctx}/js/jqzoom.pack.1.0.1.js"></script>
<script type="text/javascript" src="${ctx}/js/MapUtil.js"></script>
<style type="text/css">
#wfdd_chzn{
 display: none;
}
img {
    vertical-align: top;
}
.progress { position:relative; width:400px; border: 2px solid #ddd; padding: 1px; border-radius: 5px; }
.bar { position:absolute;background-color: #006400; left:60%;width:10%; height:30px; border-radius: 3px;}
.percent { position:absolute; display:inline-block; top:3px; left:100%;font-weight:bold }
.mask {       
            position: absolute; top: 0px; left:0; width:100%; height:100%;
            z-index: 1002; left: 0px;
        }
</style>

</head>

<script>

//显示遮罩层    
//function showMask(){     
   // $("#mask").css("height",$(document).height());     
   // $("#mask").css("width",$(document).width());     
   // $("#mask").show();     
//}  
//隐藏遮罩层  
/* function hideMask(){     
      
    $("#mask").hide();     
}  */
     $(function(){
        var bar = $('.bar');
        var percent = $('.percent');
        var status = $('#status');
        $('#uploadPicForm').ajaxForm({
            beforeSerialize:function(){
                //alert("表单数据序列化前执行的操作！");
                //$("#txt2").val("java");//如：改变元素的值
            },
            beforeSubmit:function(){
            	if($('#hphmFlag').val()=="" || $('#hpzlFlag').val()==""){
            		document.getElementById("uploadPicForm").reset();
            		alert("无机动车信息,请查询后再保存！");
            		return false;
            	}
            	try{
              		var listImgObj=document.getElementById("yxxxinfo").getElementsByTagName("img");
              		}catch(e){
              			alert("无档案信息,请上传档案文件后再保存！");
              			return;
              		}
                    $(".submitFramexs").show();
                    $("#mask").show();
            },
            beforeSend: function() {
                $(".submitFramexs").show();
                $("#mask").show();
                //status.empty();
                //showMask();
                //var percentVal = '0%';
               // var percentVal = '上传中....';
                //bar.width(percentVal);
                //percent.html(percentVal);
            },
            uploadProgress: function(event, position, total, percentComplete) {//上传的过程

                $(".submitFramexs").show();
                $("#mask").show();
                //position 已上传了多少
                //total 总大小
                //已上传的百分数
                //var percentVal = percentComplete + '%';
               // bar.width(percentVal);
                //percent.html(percentVal);
                //console.log(percentVal+"=="+position+"=="+total);
            },
            success: function(data) {//成功
                //var percentVal = '100%';
               // bar.width(percentVal)
               // percent.html(percentVal);  
                $(".submitFramexs").hide();
                $("#mask").hide();
            },
            error:function(err){//失败
            	$(".submitFramexs").hide();
                $("#mask").hide();
                alert("档案提交异常！");
            },
            complete: function(xhr) {//完成
               // status.html(xhr.responseText);
                //hideMask();
                $(".submitFramexs").hide();
                $("#mask").hide();
                if(xhr.responseText=="true" || xhr.responseText==true){
                	 alert("档案保存成功!");
                	 parent.addTab("机动车档案录入","${ctx}/yxxx/VehicleYxcjByhphmAndhpzl.htm");
                }else{
                	alert("档案保存失败!");
                }
               
            }
        });

    });
     //切换扫描仪与高拍仪
     function changeDevice(currentId){
     	if("HighShotId"==currentId){  		
     		$("#HighShotDiv").attr("style", "display:block;");
     		$("#FisScannerDiv").attr("style", "display:none;");
     		$("#captrue").attr("style", "display:block;");
     		$("#playOcx").attr("style", "display:none;");
     		Start_onclick();    			
     	}else{
     		$("#FisScannerDiv").attr("style", "display:block;");
     		$("#HighShotDiv").attr("style", "display:none;");   		
     		$("#captrue").attr("style", "display:none;");  
     		$("#playOcx").attr("style", "display:block;");
     	}
     	
     }
  //监听是否按下enter键
    document.onkeydown = function(event_e){
			if(window.event) {
			event_e = window.event;
			}
			var int_keycode = event_e.charCode||event_e.keyCode;
			if( int_keycode == '13' ) {
			queryVehInfo();
			return false;
			}
		}
  //查询机动车信息
     function queryVehInfo(){
  		   
  		   var lsh = $.trim($('#lshSelect').val());
  		   var hphm=$.trim($('#hpSelect').val());//号牌号码
  		   var hpzl=$.trim($('#hpzlSelection').combobox('getValue'));//号牌种类
  		   var reg = /[\u4e00-\u9fa5]/g;//筛选是否有中文
  		   hphm = hphm.replace(reg, "");
  		   if(lsh!="" || hphm!="" ||hpzl!=""){
  		       $.ajax({
  		           type:'post',
  		           url:'${ctx}/yxxx/queryVehcile.htm',
  		           data:{
  		               hphm:hphm,
  		               hpzl:hpzl,
  		               lsh:lsh
  		           },
  		           dataType:'json',
  		           success:function(data){
  		               if(null!=data && data!=''){ 		  
  		            	   if(data.zzz=='1'){
  		            		   alert("此机动车档案已存在，请勿重复录入！");
  		            	   }else{
  		            	   var fzjg=data.fzjg;
  		            	   if(null!=fzjg && undefined!=fzjg){
  		            		   fzjg=fzjg[0];
  		            	   }
  		            	   
  		                   $('#xhFlag').val(data.xh);
		            	   $('#hphmFlag').val(data.hphm);
		            	   $('#hpzlFlag').val(data.hpzl);		            	   
		            	   $('#clpp1Flag').val(data.clpp1);
		            	   $('#clsbdhFlag').val(data.clsbdh);
		            	   $('#fdjhFlag').val(data.fdjh);
		            	   $('#csysFlag').val(data.csys);
	                       $('#syrFlag').val(data.syr);
	                       $('#fzjgFlag').val(data.fzjg);                   
	                       $('#glbmFlag').val(data.glbm);
	                       $('#xzqhFlag').val(data.xzqh);
	                       $('#lshFlag').val(data.lsh);
	                       $('#cllyFlag').val(data.clly);
	                       	            	 
  		            	   $('#hphmmc').text(fzjg+data.hphm);
  		            	   $('#hpzlmc').text(data.hpzlmc);
  		            	   $('#clpp1').text(data.clpp1);
  	                       $('#csysmc').text(data.csysmc);
  	                       $('#syr').text(data.syr);
  	                       $('#fdjh').text(data.fdjh);
  	                       $('#clsbdh').text(data.clsbdh);
  	                       $('#cllymc').text(data.cllymc);
  		            	 }
  		               }else{
  		            	   alert('该机动车不存在，请重新查询');
  		               }
  		           }
  		       });
  		   }
     }
     
     //关闭窗口执行关闭高拍仪
     window.onunload = function(){
    	 document.getElementById("captrue").bStopPlay();
    }  
    
</script>
<body class="easyui-layout">
<div id="mask" class="mask" style="z-index:9999991; display: none;background:url(${ctx}/images/sdx.png) repeat;" >
<img src="${ctx}/images/ldd.gif" style="margin:9% auto 0; width: 245px; height: 69px; display: block;">
</div>
<iframe style=" display: none;width:100%; height:100%;position:absolute; left:0;top:0;z-index:999999;background: transparent;filter:alpha(opacity=0);  
      -moz-opacity:0;  
      -khtml-opacity:0;  
      opacity:0; " name="submitFramexs" class="submitFramexs" frameborder="no"></iframe>
<form id="gclsForm">
<div data-options="region:'center',border:false,cls:'yujszhidongshibie'" style="overflow-y :hidden;padding: 7px;">
<div class="easyui-layout" data-options="fit:true">
	<div data-options="region:'north',border:false" style="height: 36px;overflow-y :hidden; background:#f0f0f0; border:1px solid #d2d2d2; border-bottom: none;">
			<table cellspacing="0" cellpadding="0" border="0" width="100%" class="dananguanglikuang">
		     	 <tr>
		             <th align="right" height="26" width="90">号牌号码：</th>
		             <td>
		                 <a id="hphmmc" style="font-weight: bold; color: #777777;"></a>
		             </td>
		             <th align="right" height="26" width="90">号牌种类：</th>
		             <td>
		                 <a id="hpzlmc" style="font-weight: bold; color: #777777;"></a>
		             </td>
		             <th align="right" width="90">业务类型：</th>
		             <td height="26">
		             		<a id="cllymc" style="font-weight: bold; color: #777777;"></a>
		             </td>
		             <th align="right" height="26" width="90">所有人：</th>
		             <td>
		                 <a id="syr" style="font-weight: bold; color: #777777;"></a>
		             </td>
		              <th align="right" height="26" width="90">车辆识别编号：</th>
		             <td>
		                 <a id="clsbdh" style="font-weight: bold; color: #777777;"></a>
		             </td>
		            
		    </table>
		    </div>
		    <div data-options="region:'center',border:false" style="position:relative;border:1px solid #d2d2d2;">
		   
		   <div class="easyui-layout" data-options="fit:true" style=" position: relative;">
		    <div data-options="region:'center',border:false">
		       <object id="playOcx" classid="clsid:BCB28301-A827-4DE4-BA67-623FAC960893"  width="100%" height="100%" style="display: none;"> </object>
		       <object id="captrue" classid="clsid:454C18E2-8B7D-43C6-8C17-B1825B49D7DE"  width="100%" height="100%"  ></object>
		    </div>
<!-- 		    <div style="float:left;" id="captrueDiv" style="display: none;">
				<object classid="clsid:454C18E2-8B7D-43C6-8C17-B1825B49D7DE" id="captrue"  width="700" height="540" ></object>
			</div> -->
			<div data-options="region:'east',border:false" style=" width:141px;border-left:1px solid #d2d2d2; position: relative;">
		    <ul class="qiehuangaopsaomy">
			  <li onClick="changeDevice(this.id)" id="FisScannerId" class="hovergaopaisaom"> <a href="#" >扫描仪</a></li> 
			  <li onClick="changeDevice(this.id);" id="HighShotId"> <a href="#">高拍仪</a></li> 
		    </ul>
		    <div id="deviceOperation" >
		    <div id="HighShotDiv" style="display:none;">
		    <div class="jichenganniuzai">
			    <!--  <a id="uploadwww" href="#" class="yangshianniu3"  onClick="javascript:Start_onclick();" style="visibility: visible;">开启</a>
			     <a id="uploadwww" href="#" class="yangshianniu4" onClick="javascript:Stop_onclick();" style="visibility: visible;">关闭</a> -->
				 <a id="uploadwww" href="#" class="yangshianniu3" onClick="javascript:shot();" style="visibility: visible;">拍摄</a>
				 <a class="yangshianniu5" href="###" onClick="javascript:uploadPicAndSave()">保存上传</a>
		    </div>
		   <!--  <table cellspacing="0" cellpadding="0" border="0" width="189" class="cheliangxinxi" style=" position: absolute; left:5px; bottom:7px; margin-bottom: 0;">	
			    <input type="hidden" id="docMode" value="1" name="mode" onClick="setMode(this)" checked="checked"/>
			    <tr>
				  <th align="center">曝光度</th>
				  <td>
					<select id="exposure" onChange="setExposure(this)">
						<option value="100">100</option>
						<option value="90">90</option>
						<option value="80">80</option>
						<option value="70">70</option>
						<option value="60">60</option>
						<option value="50" selected="selected">50</option>
						<option value="40">40</option>
						<option value="30">30</option>
						<option value="20">20</option>
						<option value="10">10</option>
						<option value="0">0</option>					
					</select>
				</td>
				</tr>
				<tr>
				<th align="center">参数设置</th>
				<td>
					<input type="button" value="参数设置" onClick="ParaSet_onclick()">&nbsp;
				</td>
				</tr>
				<tr>
				<th align="center">PIN</th>
				<td>
				   <input type="button" value="PIN" onClick="pin()">&nbsp;
				</td>
				</tr>
				<tr>
				<th align="center">DPI</th>
				<td>
				   <input type="button" value="DPI" onClick="setDpi()">&nbsp;
				</td>
				</tr>
				</table> -->
			</div>
		    <div id="FisScannerDiv" style="display:block;">	    		    
	  			<div class="jichenganniuzai">
				<a class="yangshianniu1" href="###" onclick="selectScanner()">选择扫描仪</a>
				<a class="yangshianniu2" href="###" onclick="startScan()">开始扫描</a>
				<a class="yangshianniu5" href="###" onClick="javascript:uploadPicAndSave()">保存上传</a>
				</div>
				<table cellspacing="0" cellpadding="0" border="0" width="130" class="cheliangxinxi" style=" position: absolute; left:5px; bottom:7px; margin-bottom: 0;">			    				
				<tr>
				  <th align="center">分辨率</th>
				  <td>
				    <input type="radio" name="Resolution" value="0" checked="checked"/>200 dpi<br />
				    <input type="radio" name="Resolution" value="1" />300 dpi<br />
				  </td>
				</tr>
				<tr>
				  <th align="center">进纸模式</th>
				  <td>
				    <input type="radio" name="PaperSupply" value="1" checked="checked"/>ADF正面<br />
				    <input type="radio" name="PaperSupply" value="2" />ADF双面<br />
				  </td>
				</tr>
				</table>
				<!-- <table cellspacing="0" cellpadding="0" border="0" width="189" class="cheliangxinxi" style=" position: absolute; left:5px; bottom:7px; margin-bottom: 0;">			    
				 <tr>
				  <th align="center">像素类型</th>
				  <td>
				    <input type="radio" name="PixelType" value="0" />黑白<br />
				    <input type="radio" name="PixelType" value="1" />灰度<br />
				    <input type="radio" name="PixelType" value="2" checked="checked" />彩色<br />
				  </td>
				</tr>
				
				<tr>
				  <th align="center">分辨率</th>
				  <td>
				    <input type="radio" name="Resolution" value="2" checked="checked"/>300 dpi<br />
				    <input type="radio" name="Resolution" value="3" />400 dpi<br />
				    <input type="radio" name="Resolution" value="4" />500 dpi<br />
				    <input type="radio" name="Resolution" value="5" />600 dpi<br />
				  </td>
				</tr>
				<tr>
				  <th align="center">进纸模式</th>
				  <td>
				    <input type="radio" name="PaperSupply" value="1" checked="checked"/>ADF正面<br />
				    <input type="radio" name="PaperSupply" value="2" />ADF双面<br />
				  </td>
				</tr>
				</table> -->
				</div>						
		    </div>	
		   </div>	
		   </div>		    		
		    </div>				    			    
</div>
</div>

	<div data-options="region:'east',border:false" style="width: 330px;overflow-y :hidden;padding: 7px 7px 7px 2px;">
	    	<div class="easyui-layout" data-options="fit:true" style="border:1px solid #d2d2d2;">
	    		<div data-options="region:'north',border:false" style="height: 88px; position: relative;">
	    				<table cellspacing="0" cellpadding="0" border="0" width="100%" class="dananguanglikuang2">				  
					     	 <tr>
						     	 <th align="right" height="26" width="80">流水号：</th>
									<td align="right" height="20"
										class="tangchukuangliebiao1">
										<input id="lshSelect" style="width: 95%;" type="text" class="shurukuangkais" placeholder="请输入流水号" value=""  /> <!-- placeholder="请输入号牌号码" value="" -->
									</td>
							</tr>
							<tr>
							  <th align="right" height="26" >号牌号码：</th>
								<td align="right" class="tangchukuangliebiao1">
									<input id="hpSelect" style="width: 95%;" type="text" class="shurukuangkais" value="皖" />
									</td>
							</tr>
							<tr>
								<th align="right" height="26">号牌种类：</th>
								<td>
					                 <input type="text" id="hpzlSelection" class="easyui-combobox "
					                        data-options="prompt:'请选择号牌种类',url:'${ctx}/code/findCodeByCodetype.htm?xtlb=00&dmlb=1007',valueField:'dmz',textField:'dmsm1mc',editable:false" style="width: 140px;">
					             </td>
							</tr>
				</table>
					<a href="javascript:queryVehInfo();" class="congzhim" id="shenqingcx"  style="margin: 0 5px 2px 0; position: absolute; bottom:5px;right:12px;">查询</a>
	    		</div>
				<div data-options="region:'center',border:false" style="overflow-y :hidden">
							<p class="shipingjiemiangtanggr_top">
								<i class="addNumssji">共扫描<span id="addNums">0</span>张图片</i>
								采集记录 
							</p>
							<div class="shipingjiemiangtanggr_bottom" id="yxxxinfo2" style=" overflow: auto;">
									<ul id="yxxxinfo" style="position: relative;padding: 0 0 30px 0;">
									</ul>
							</div>
				</div>
				<div data-options="region:'south',border:false" style="height: 30px;">
					<div class="diyipaidhusnfhenfnf1">
	         	       <a id="selectAllId" href="#" class="congzhim" onClick="javascript:selectAll();" style="visibility: visible;">全选</a>	             	            
	        	       <a id="delId" href="#" class="congzhim" onClick="javascript:delByselect();" style="visibility: visible;">删除</a>	             	            	              
		               <!-- <a id="saveId" href="#" class="congzhim" onClick="javascript:uploadPicAndSave();" style="visibility: visible;">保存上传</a>	 -->             	            
		             </div> 
				</div>
			</div>

	    </div>
	    </form>
	    <div style="display: none;">
			<form id="uploadPicForm" name="uploadPicForm" action="${ctx}/imageitem/UploadImageFtp.htm" method="post" enctype="multipart/form-data" target="submitFrame">  <!-- target="submitFrame" -->
				    <input type="hidden" id="xhFlag" name="xh" />
					<input type="hidden" id="hphmFlag"  name="hphm" />
					<input type="hidden" id="hpzlFlag"  name="hpzl" />
					<input type="hidden" id="clpp1Flag" name="clpp1" />
					<input type="hidden" id="clsbdhFlag" name="clsbdh" />
					<input type="hidden" id="fdjhFlag"  name="fdjh" />
					<input type="hidden" id="csysFlag"  name="csys" />
					<input type="hidden" id="syrFlag"   name="syr" />
					<input type="hidden" id="fzjgFlag"  name="fzjg" />
					<input type="hidden" id="glbmFlag"  name="glbm" />
					<input type="hidden" id="xzqhFlag"  name="xzqh" />
					<input type="hidden" id="lshFlag"   name="lsh" />
					<input type="hidden" id="cllyFlag"  name="clly" />
					
				 <textarea id="imageBase64Shot" name="imageBase64Shot"></textarea>
				 <textarea id="imageBase64" name="imageBase64"></textarea>
				 <textarea id="fileTypeArea" name="fileTypeArea"></textarea>
				 <textarea id="fileNameArea" name="fileNameArea"></textarea>
			</form>
			<iframe style="width:0; height:0; margin-top:-10px;display: none;" name="submitFrame" src="about:blank"></iframe>
		</div>
		<!-- 扫描仪对象 -->
		<object id="fhkScan" width="0" height="0" classid="clsid:07cf3b59-2cf2-4ee2-bcef-1320638005e7"></object>
		<object id="img2base64" width="0" height="0" classid="clsid:4CAF60C8-668C-4E69-8C0A-9A8E0833F3FB"></object>	
	    <!-- 高拍仪对象 -->
<!-- 		<object classid="clsid:454C18E2-8B7D-43C6-8C17-B1825B49D7DE" id="captrue"  width="0" height="0" ></object>
 -->		<object classid="clsid:8622e61a-22d1-4c10-9ecc-4dfc1f9a4f03" id="cap" width="0" height="0"></object>
        <!-- 图片处理对象 -->
        <!-- <div id="playOcxPic" >  style="display: none;"
          <object id="playOcx" classid="clsid:BCB28301-A827-4DE4-BA67-623FAC960893"  width="600" height="407"> </object>
		</div> -->
</body>
<script type="text/javascript">
$(window).resize(function() {
	ydpheight();
});

$(function(){
	ydpheight();
	$(".qiehuangaopsaomy li").click(function(){
			$(".qiehuangaopsaomy li").removeClass("hovergaopaisaom");
			$(this).addClass("hovergaopaisaom");
	})
});

function ydpheight(){
	var ultouchLi = $(".shipingjiemiangtanggr_bottom");
	ultouchLi.css("height",$(window).height()-160 +"px");
	}

  //显示大图
  function changeSrc(thisDoc){
		$("#captrue").attr("style", "display:none;");  
		$("#playOcx").attr("style", "display:block;");
		
		/* var playPic = "";
		$("#tpStyle").html("");
		playPic +="<img id=\"imggc\"  onerror=\"javascript:this.src='${ctx}/images/wutuffs.png'\" src=\""+srcValue+"\">";
		$("#tpStyle").html(playPic); */
 		 //本地地址传参数0
		//document.getElementById("playOcx").BindImage(thisDoc.src.substring(thisDoc.src.indexOf("///")+3), 0);
		document.getElementById("playOcx").BindImage(thisDoc.name,0);
		//加水印
		//document.getElementById("playOcx").WaterImage();
	}
  //删除选中项
  function delByselect(){
	  /* $("input[name='checkbox1']:checked").each(function(i,n){
	        var logoid=$(this).val();
	        if(i==0){
	            logoids+=logoid;
	        }else{
	            logoids+=","+logoid;
	        }
	    });*/
	  var  checkboxArray =[];
		var ckbs = document.getElementById("yxxxinfo").getElementsByTagName("input");
		var len = ckbs.length;
		for(var i=0;i<len;i++){
		    if(ckbs[i].type == "checkbox" && ckbs[i].checked==true){
		    	checkboxArray.push(ckbs[i].value); 
		  }
		}
		for(var j=0;j<checkboxArray.length;j++){
			 $("#"+checkboxArray[j]).parent().remove();
			 v_addNums--;
			 $('#addNums').text(v_addNums); //显示当前档案数
			 //map.remove(checkboxArray[j]);
		  } 
  }
/*   $('#yxxxinfo li').live('click',function(){
		//$('input').removeAttr('checked');	
	 	if($(this).find("input[type='checkbox']").prop("checked")){
			$(this).find("input[type='checkbox']").prop('checked',false); 
		}else{
			$(this).find("input[type='checkbox']").prop('checked',true);
		}  
	}) */
	//全部选中
	function selectAll(){
	        if($("input[name='checkbox1']").prop("checked")){
	        	$("input[name='checkbox1']").prop("checked", false);         	
			}else{
				$("input[name='checkbox1']").prop("checked", true); 
			}  
  		}
		
    //上传图片并保存
    function uploadPicAndSave(){
   	var imgArray = document.getElementById("yxxxinfo").getElementsByTagName("img");
	if(imgArray.length<1){
		alert("无档案信息,请上传档案文件后再保存！");
		return;
	}
	/* for(var i=0;i<imgArray.length;i++){
		if($(imgArray[i]).parent().children("input[name='fileTypeFlag']").val()==null || $(imgArray[i]).parent().children("input[name='fileTypeFlag']").val()==''){
			alert("有档案类型未标注！");
			return;
		}				
	} */
	var imageBase64ShotResults = document.getElementById("imageBase64Shot");
    var imageBase64Results = document.getElementById("imageBase64");
    var fileTypeAreaResults = document.getElementById("fileTypeArea");   
    var fileNameAreaResults = document.getElementById("fileNameArea");
    var imageBase64ShotStr =imageBase64ShotResults.value;
    var imageBase64Str =imageBase64Results.value;
    var fileTypeAreaStr =fileTypeAreaResults.value;
    var fileNameAreaStr =fileNameAreaResults.value;
    for(var i=0;i<imgArray.length;i++){
    	 if(imageBase64ShotStr!=''){
    	if(imgArray[i].src.indexOf("http://")!=-1){
    		imageBase64ShotStr +=',';
    		imageBase64ShotStr +=imgArray[i].src;
    		imageBase64Str +=',';
    		imageBase64Str +=imgArray[i].src.replace(".thm","");
    		fileTypeAreaStr +=',';
    		fileTypeAreaStr +=$(imgArray[i]).parent().children("input[name='fileTypeFlag']").val();    		
    	}else{
    		imageBase64ShotStr +=',';   		
    		imageBase64ShotStr += imgArray[i].src.replace("data:image/jpeg;base64,","");
    		imageBase64Str +=',';
    		imageBase64Str += document.getElementById("captrue").Base64Encode(imgArray[i].name);
    		fileTypeAreaStr +=',';
    		fileTypeAreaStr += $(imgArray[i]).parent().children("input[name='fileTypeFlag']").val();  		
    	}
    	fileNameAreaStr +=',';
		//fileNameAreaStr +=imgArray[i].src.substring(imgArray[i].src.lastIndexOf("/")+1,imgArray[i].src.lastIndexOf("."));
    	fileNameAreaStr +=imgArray[i].name.substring(imgArray[i].name.lastIndexOf("\\")+1);
      }else{
    	  if(imgArray[i].src.indexOf("http://")!=-1){
    		imageBase64ShotStr +=imgArray[i].src;
      		imageBase64Str +=imgArray[i].replace(".thm","");
    		fileTypeAreaStr +=$(imgArray[i]).parent().children("input[name='fileTypeFlag']").val();
      	}else{
      		imageBase64ShotStr += imgArray[i].src.replace("data:image/jpeg;base64,","");
      		imageBase64Str += document.getElementById("captrue").Base64Encode(imgArray[i].name);
      		//imageBase64Str += document.getElementById("captrue").Base64Encode(imgArray[i].src.substring(imgArray[i].src.indexOf("///")+3));
    		fileTypeAreaStr += $(imgArray[i]).parent().children("input[name='fileTypeFlag']").val();
    		//alert(imgArray[i].src+"=="+captrue.Base64Encode(imgArray[i].src.substring(imgArray[i].src.indexOf("///")+3)));
      	}
  		//fileNameAreaStr +=imgArray[i].src.substring(imgArray[i].src.lastIndexOf("/")+1,imgArray[i].src.lastIndexOf("."));
    	  fileNameAreaStr +=imgArray[i].name.substring(imgArray[i].name.lastIndexOf("\\")+1);
      } 
    }

    imageBase64ShotResults.value=imageBase64ShotStr;
    imageBase64Results.value=imageBase64Str;
    fileTypeAreaResults.value=fileTypeAreaStr;
    fileNameAreaResults.value=fileNameAreaStr;
    $("#uploadPicForm").submit();
    }
    //增加列表图片
    function addPic(Str,randDom,FileDir){
    	
    	var tableBodyStr="";
	  	tableBodyStr += "<li>";	  	
	  	tableBodyStr += "<input type=\"hidden\" name=\"picIpFlag\">";
	  	tableBodyStr += "<input type=\"hidden\" name=\"fileTypeFlag\" value=\"0\">";
		tableBodyStr += "<input type=\"checkbox\" class=\"dingweixuanzhongk\" name=\"checkbox1\" id=\""+randDom+"\" value=\""+randDom+"\">";
		tableBodyStr += "<input type=\"checkbox\"  name=\"checkbox2\"  value=\"chk"+randDom+"\"  style=\"display:none;\">";
		tableBodyStr += "<img id=\""+randDom+"\" name=\""+FileDir+"\" src=\"data:image/jpeg;base64,"+Str+"\" height=\"100%\" style=\"float: left; margin: 0 5px 0 0;\" onclick=\"javascript:changeSrc(this)\">";
		/* tableBodyStr += "<select class=\"dingweixialak1\" onchange=\"OnChangFunc(this)\"> "+
						"  <option value =\"\" selected >请选择档案类型</option> "+
						"  <option value =\"1\">业务申请表</option> "+
						"  <option value =\"2\">所有人身份证明</option> "+
						"  <option value =\"3\">机动车来历凭证</option> "+
						"  <option value =\"4\">机动车检查记录表</option> "+
						"  <option value =\"5\">合格证或进口说明书</option> "+
						"  <option value =\"6\">机动车交强险凭证</option> "+
						"  <option value =\"7\">购置税</option> "+
						"</select>";	 */
		
		tableBodyStr += "<input  type=\"button\" id=\"deletePic"+randDom+"\" onclick=\"delByselectSin(this.id);\" value=\"删除\" class=\"deletetp\"/> ";
		tableBodyStr += "<input  type=\"button\" id=\"replacePic"+randDom+"\" name=\"replaceName\" onclick=\"checkStaFunc(this.id);\" value=\"替换\" class=\"tihuantp\"/>";
		tableBodyStr += "<div class=\"dingweixialak100\"> "+
		"  <div class=\"xuanzhebixuan\" title=\"业务申请表\" onclick=\"OnChangFunc(this)\"><label><input type=\"radio\" style=\"display:none\" name=\"ztyanshi\" value=\"1\"/>申请表</label></div> "+
		"  <div class=\"xuanzhebixuan\" title=\"所有人身份证明\" onclick=\"OnChangFunc(this)\"><label><input type=\"radio\" style=\"display:none\" name=\"ztyanshi\" value=\"2\"/>身份证明</label></div> "+
		"  <div class=\"xuanzhebixuan\" title=\"机动车来历凭证\" onclick=\"OnChangFunc(this)\"><label><input type=\"radio\" style=\"display:none\" name=\"ztyanshi\" value=\"3\"/>来历凭证</label></div> "+
		"  <div class=\"xuanzhebixuan\" title=\"机动车查验记录表\" onclick=\"OnChangFunc(this)\"><label><input type=\"radio\" style=\"display:none\" name=\"ztyanshi\" value=\"4\"/>查验记录表</label></div> "+
		"  <div class=\"xuanzhebixuan\" title=\"合格证或进口说明书\" onclick=\"OnChangFunc(this)\"><label><input type=\"radio\" style=\"display:none\" name=\"ztyanshi\" value=\"5\"/>合格证</label></div> "+
		"  <div class=\"xuanzhebixuan\" title=\"机动车交强险凭证\" onclick=\"OnChangFunc(this)\"><label><input type=\"radio\" style=\"display:none\" name=\"ztyanshi\" value=\"6\"/>交强险凭证</label></div> "+
		"  <div class=\"xuanzhebixuan\" title=\"机动车购置税凭证\" onclick=\"OnChangFunc(this)\"><label><input type=\"radio\" style=\"display:none\" name=\"ztyanshi\" value=\"7\"/>购置税凭证</label></div> "+ 
		"</div>";
		
		tableBodyStr += "</li>";
		//document.getElementById('yxxxinfo').innerHTML+=tableBodyStr;	 //innerHTML 会刷新整个id内容，append不会
		$('#yxxxinfo').append(tableBodyStr);
		var a = $('#yxxxinfo2');
        a.scrollTop(a[0].scrollHeight);
    }
    //设置档案文件类型标识
    function OnChangFunc(obj){
  	  //var selectedOption=obj.options[obj.selectedIndex];
  	  //console.info($(obj).prev()[0].getAttribute("name"));
  	  $(obj).parent().parent().children("input[name='fileTypeFlag']").val($(obj).children().children().val());
  	  $(obj).parent().find(".xuanzhebixuan").removeClass("hoverbiaoshi");
  	  $(obj).addClass("hoverbiaoshi");
    }
	function checkStaFunc(id) {
		var obj=$("#"+id).parent().find('input[name=checkbox2]');
		$('#yxxxinfo > li > input[name=checkbox2]').each(function () {
		//	console.info($(this).prop('checked'));
        if ($(this).val() == $(obj).val()){
		   if($(this).prop("checked")){
				$(this).prop("checked", false);
				document.getElementById(id).style.background="#ff4d4d";
		   }else{
				$(this).prop("checked", true);
				document.getElementById(id).style.background="#808080";
		   }
		}
        else{
           $(this).prop("checked", false);
        }
     });
		
	}
    function delByselectSin(id){
    	v_addNums--;
		$('#addNums').text(v_addNums);
    	$("#"+id).parent().remove();
    }
    //生成固定长度随机数
    function GetRandomNum(n){
	    var chars = ['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
         var res = "";
         for(var i = 0; i < n ; i ++) {
             var id = Math.ceil(Math.random()*35);
             res += chars[id];
         }
         return res;
    }
</script>
<!-- 扫描仪脚本 开始-->

<script>
 var savePath="D:\\image\\";
 var v_addNums=0;  //当前页面扫面记录数

//选择扫描仪
function selectScanner()
{
	var rtn = document.getElementById("fhkScan").SelectSource(0);
	if (rtn == -1)
	{
		alert("Select scanner error, error code = " + fhkScan.ErrorCode);
	}
}
//初始化扫描仪
function InitSettings()
{
	//本地路径设置
	//fhkScan.FileName = document.getElementById("scanPath").value;
	
	var filenamePrefix = new Date().getTime();
	document.getElementById("fhkScan").FileName = "D:\\image\\"+filenamePrefix;
	//设置像素类型：pixelType
	var pixelType = 2;
	/* var rdbPixelType = document.getElementsByName("PixelType");
	for (var i = 0; i < rdbPixelType.length; i++)
	{
		if (rdbPixelType[i].checked)
		{
			pixelType = rdbPixelType[i].value;
			break;
		}
	} */
	if (pixelType == 0)
	{
		// Scan to Black & White
		document.getElementById("fhkScan").PixelType = 0;				// 0 - Black & White, 1 - Grayscale, 2 - RGB Color
		document.getElementById("fhkScan").FileType = 1;				// 0 - BMP, 1 - TIFF, 2 - Multipage TIFF, 3 - JPEG
		document.getElementById("fhkScan").CompressionType = 4;		// 0 - No compress, 4 - CCITT G4 (only for B&W), 5 - JPEG
	}
	else
	{
		// Scan to Gray or Color
		document.getElementById("fhkScan").PixelType = pixelType;		// 0 - Black & White, 1 - Grayscale, 2 - RGB Color
		document.getElementById("fhkScan").FileType = 3;				// 0 - BMP, 1 - TIFF, 2 - Multipage TIFF, 3 - JPEG
		document.getElementById("fhkScan").JPGQuality = 4;				// JPEG data compression level, 0 (small file size) ~ 6 (large file size)
		//fhkScan.CompressionType = 5;
	}

	//设置分辨率:resolution
	var resolution = 0;
	var rdbResolution = document.getElementsByName("Resolution");
	for (var i = 0; i < rdbResolution.length; i++)
	{
		if (rdbResolution[i].checked)
		{
			resolution = rdbResolution[i].value;
			break;
		}
	}
	document.getElementById("fhkScan").Resolution = resolution;		// 0 - 200 dpi, 1 - 240 dpi, 2 - 300 dpi, 3 - 400 dpi, 4 - 500 dpi, 5 - 600 dpi

	//设置进纸模式:paperSupply
	var paperSupply = 1;
	var rdbPaperSupply = document.getElementsByName("PaperSupply");
	for (var i = 0; i < rdbPaperSupply.length; i++)
	{
		if (rdbPaperSupply[i].checked)
		{
			paperSupply = rdbPaperSupply[i].value;
			break;
		}
	}
	// 0 - Flatbed, 1 - ADF front, 2 - ADF double 3 - Auto
	if(paperSupply==3)
	{
		document.getElementById("fhkScan").PaperSupply =2;				
		document.getElementById("fhkScan").AutomaticSenseMedium=true;
	}
	else 
	{
		document.getElementById("fhkScan").PaperSupply = paperSupply;
		document.getElementById("fhkScan").AutomaticSenseMedium=false;
	}
	//设置旋转角度:scanRotate
	/* var scanRotate = 0;
	var rdbScanRotate = document.getElementsByName("ScanRotate");
	for (var i = 0; i < rdbScanRotate.length; i++)
	{
		if (rdbScanRotate[i].checked)
		{
			scanRotate = rdbScanRotate[i].value;
			break;
		}
	} */
	document.getElementById("fhkScan").ScanRotate = 4;		// 0 - None, 1 - 90 degrees, 2 - 180 degrees, 3 - 270 degrees, 4 - Automatic
	//跳过空白页：SkipWhitePage
	/* var chkSkipWhitePage = document.getElementById("SkipWhitePage");
	if (chkSkipWhitePage.checked)
	{
		fhkScan.SkipWhitePage = 6; 			// 0 - Do not skip, 1~15 - the ratio of black dots in the white page
	}
	else
	{
		fhkScan.SkipWhitePage = 0; 			// 0 - Do not skip, 1~15 - the ratio of black dots in the white page
	} */
	document.getElementById("fhkScan").SkipWhitePage = 6;
	
	//显示源用户界面:chkShowSourceUI
	/* var chkShowSourceUI = document.getElementById("ShowSourceUI");
	if (chkShowSourceUI.checked)
	{
		fhkScan.ShowSourceUI = true;		// true - Display the scanner source UI, false - Do not display
	}
	else
	{
		fhkScan.ShowSourceUI = false;		// true - Display the scanner source UI, false - Do not display
	} */
	document.getElementById("fhkScan").ShowSourceUI = false; 
	//文件重写提示:chkPromptOverwrite
	/* var chkPromptOverwrite = document.getElementById("PromptOverwrite");
	if (chkPromptOverwrite.checked)
	{
		fhkScan.Overwrite = 2;
	}
	else
	{
		fhkScan.Overwrite = 1;
	} */
	document.getElementById("fhkScan").Overwrite = 1;  //2 :提示，1：自动覆盖
	
	document.getElementById("fhkScan").ScanTo = 0;					// 0 - to File, 1 - to DIB, 2 - to Memory, Suggest to File
	document.getElementById("fhkScan").ScanCount = -1;				// Number of pages to scan, -1 - all pages on ADF
	document.getElementById("fhkScan").DetectPageSize = 2;
	document.getElementById("fhkScan").SourceCurrentScan = 0;
}
//扫描入口
function startScan() 
{
	InitSettings(); //参数初始化
	var rtn = document.getElementById("fhkScan").OpenScanner(0); //打开扫描仪
	if (rtn == -1)
	{
	    alert("Open scanner error, error code = " + fhkScan.ErrorCode);
		return;
	} 	
	rtn = document.getElementById("fhkScan").StartScan(0); //开始扫描
	if (rtn == -1)
	{
		alert("Start scan error, error code = " + fhkScan.ErrorCode);
	}
	document.getElementById("fhkScan").CloseScanner(0); //关闭扫描
}

//var map = new Map();

//扫描绑定事件，美扫描一次，调用一次此事件
function OnScanToFileEvent(scanFilePath)
{
	// Transform scanned jpg file to Base64 string
	// parameters:
	//   1. full path of the file to be transformed
	//   2. true - delete source jpg file, false - keep the jpg file
	//var base64 = img2base64.DoTrans(scanFilePath, false);  //原图片转换成Base64

	/* var imageBase64Results = document.getElementById("imageBase64");
	var imageBase64Str = imageBase64Results.value;
	if(imageBase64Str!=''){
	    imageBase64Str +=','
	    imageBase64Str += base64;
	}else{
		imageBase64Str += base64;
	}
	addPic(scanFilePath);
	imageBase64Results.value=imageBase64Str; */
	
	var randDom=GetRandomNum(15);
	//var fileName=scanFilePath.substring(scanFilePath.lastIndexOf("\\")+1,scanFilePath.lastIndexOf("."));
	//map.put(randDom,base64);
	var base64 = img2base64.DoThumbnailTrans(scanFilePath, 300); //生成base64缩略图编码
	
	 var flag="0";
	 $('#yxxxinfo > li > input[name=checkbox2]').each(function () {
		
		   if($(this).prop("checked")){
			var obj=$(this).parent().find('img');
		     obj[0].src="data:image/jpeg;base64,"+base64;
		     obj[0].name=scanFilePath;
		     flag="1";
		     $(this).prop("checked",false);
		     var ReplaceId=$(this).parent().find('input[name=replaceName]')[0].getAttribute("id");		     
			 document.getElementById(ReplaceId).style.background="#ff4d4d";
		     return;
		   }
		  
     });
	 if(flag!="1"){
 		addPic(base64,randDom,scanFilePath);
		v_addNums++;
		$('#addNums').text(v_addNums);
	 }
}
</script> 

<script for="fhkScan" event="ScanToFile(scanFilePath)">
	OnScanToFileEvent(scanFilePath);
</script>

<!-- 扫描仪脚本 结束-->

<!-- 高拍仪脚本 开始-->
<script>
	
	//开启摄像头
	function Start_onclick()
	{
		document.getElementById("captrue").bStopPlay();
		document.getElementById("captrue").bStartPlay();
	}
	//关闭摄像头
	function Stop_onclick()
	{
		document.getElementById("captrue").bStopPlay();
	}
	//参数设置
	function ParaSet_onclick() {
		document.getElementById("captrue").displayVideoPara();		
	}
	//设置Dpi
	function setDpi(){
		document.getElementById("captrue").vSetDpi(600,600);
	}
	//拍摄
	function shot(){
		if($("#captrue").css("display")=='none'){
			var msg = "当前不在拍摄模式，是否切换到拍摄模式？\n\n\t请确认或取消！";
			if (confirm(msg)==true){
				$("#HighShotDiv").attr("style", "display:block;");
		 		$("#FisScannerDiv").attr("style", "display:none;");
		 		$("#captrue").attr("style", "display:block;");
		 		$("#playOcx").attr("style", "display:none;");
		 		return true;
			}else{
				return false;
			}
		} 
		var filenamePrefix = new Date().getTime();
		var FileName=savePath+filenamePrefix+".jpg";
		var randDom=GetRandomNum(15);
		var r = document.getElementById("captrue").bSaveJPG(savePath,filenamePrefix);
		document.getElementById("captrue").bRotateJpgImage(savePath+filenamePrefix+".jpg",90);
		//var str = cap.AddImage(savePath+d+".jpg"); 
		//设置水印
		/* var lsh= $("#lshFlag").val();
		document.getElementById("captrue").vSetWaterPrint(1,lsh,0);
		document.getElementById("captrue").vSetWaterPrintFontSize(500);
		document.getElementById("captrue").vSetWaterPrintFontColor(0xCD2626);
		document.getElementById("captrue").vSetWaterPrintPos(600,200); */
		var base64 = img2base64.DoThumbnailTrans(FileName, 300);
		 var flag="0";
		 $('#yxxxinfo > li > input[name=checkbox2]').each(function () {
			
			   if($(this).prop("checked")){
				var obj=$(this).parent().find('img');
			     obj[0].src="data:image/jpeg;base64,"+base64;
			     obj[0].name=FileName;
			     flag="1";
			     $(this).prop("checked",false);
			     var ReplaceId=$(this).parent().find('input[name=replaceName]')[0].getAttribute("id");		     
				 document.getElementById(ReplaceId).style.background="#ff4d4d";
			     return;
			   }
			  
	     });
		 if(flag!="1"){
	 		addPic(base64,randDom,FileName);
			v_addNums++;
			$('#addNums').text(v_addNums);
		 }
	}
	//PIN设置
	function pin() {
		document.getElementById("captrue").vSetCapturePin();
		var modes = document.getElementsByName("mode");
		var value;
		for(var i = 0;i < modes.length;i ++) {
			if(modes[i].checked) value = modes[i].value;
		}
		if(value == 1) {
			document.getElementById("captrue").bStartPlay();
			//captrue.bSetMode(3);
		} else if(value == 2) {
			document.getElementById("captrue").bStartPlay2(0);
		} 
	}
	function setMode(el) {
		var value = el.value;
		if(value == 1) {
			document.getElementById("captrue").bStopPlay();
			document.getElementById("captrue").bStartPlay();
			//captrue.bSetMode(3);
		} else if(value == 2) {
			document.getElementById("captrue").bStopPlay();
			document.getElementById("captrue").bStartPlay2(0);
		} 
	}
	//设置曝光率
	function setExposure(el) {
		document.getElementById("captrue").vSetExposure(el.value);
	}
</script>
<!-- 高拍仪脚本 结束-->
</html>